package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpYAccountCustomerDetailsAddressesTabPageUtil extends SeleniumPageUtil {
	
	public final static By CDAT_SPAN_MAIN_HEADER = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_Header_TitleCell");
	public final static By CDAT_IMG_REPORT_PREFERENCES = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_Header_imgPreferences");
	public final static By CDAT_IMG_EXPORT = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_Header_imgExcelExport");
	public final static By CDAT_LINK_NEW = By.xpath("//*[@id='e0dce11b-40ad-4118-b5d9-84bb06c2b270']/a");
	public final static By CDAT_TD_PAGE = By.xpath("//*[@id='ParentChildContainer_PnlChildControl']/table[2]/tbody/tr/td[1]");
	public final static By CDAT_SPAN_PAGE_START_NO = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_PagingTop_lblPagingPageNumber");
	public final static By CDAT_TD_OF = By.xpath("//*[@id='ParentChildContainer_PnlChildControl']/table[2]/tbody/tr/td[3]");
	public final static By CDAT_SPAN_PAGE_COUNT = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_PagingTop_lblPagingPageCount");
	public final static By CDAT_INPUT_FIRST = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_PagingTop_imgFirst");
	public final static By CDAT_INPUT_PREVIOUS = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_PagingTop_imgPrevious");
	public final static By CDAT_INPUT_NEXT = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_PagingTop_imgNext");
	public final static By CDAT_INPUT_LAST = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_PagingTop_imgLast");
	public final static By CDAT_IMG_FILTER_0 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_filter_0");
	public final static By CDAT_IMG_FILTER_1 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_filter_1");
	public final static By CDAT_IMG_FILTER_2 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_filter_2");
	public final static By CDAT_IMG_FILTER_3 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_filter_3");
	public final static By CDAT_IMG_FILTER_4 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_filter_4");
	public final static By CDAT_IMG_FILTER_5 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_filter_5");
	public final static By CDAT_IMG_FILTER_6 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_filter_6");
	public final static By CDAT_IMG_FILTER_7 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_filter_7");
	public final static By CDAT_IMG_FILTER_8 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_filter_8");
	public final static By CDAT_IMG_FILTER_9 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_filter_9");
	public final static By CDAT_IMG_FILTER_10 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_filter_10");
	public final static By CDAT_IMG_FILTER_11 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_filter_11");
	public final static By CDAT_TH_CUST_ADDR_ID = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_sort_0");
	public final static By CDAT_TH_ADDRESS_NAME = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_sort_1");
	public final static By CDAT_TH_ADDRESS1 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_sort_2");
	public final static By CDAT_TH_ADDRESS2 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_sort_3");
	public final static By CDAT_TH_ADDRESS3 = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_sort_4");
	public final static By CDAT_TH_CITY = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_sort_5");
	public final static By CDAT_TH_STATE = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_sort_6");
	public final static By CDAT_TH_ZIP = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_sort_7");
	public final static By CDAT_TH_COUNTRY = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_sort_8");
	public final static By CDAT_TH_PHONE = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_sort_9");
	public final static By CDAT_TH_PRIMARY_CONTACT = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_sort_10");
	public final static By CDAT_TH_SMS = By.id("ParentChildContainer_CustomerDetails_Addresses1_AddressListReport_sort_6");
	
	
	public static void enterYourAccountCustomerDetailsAddressesPage(){
		SpHomePageUtil.enter();
		SpHomePageUtil.enterYourAccountCustomerDetailsDefaultPage();
		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpYAccountCustomerDetailsDefaultPageUtil.YACD_TAB_ADDRESSES));
		waitForPageToLoad();
	}
	
	public static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				CDAT_LINK_NEW, CDAT_IMG_REPORT_PREFERENCES, CDAT_IMG_EXPORT, CDAT_INPUT_FIRST, CDAT_INPUT_PREVIOUS, CDAT_INPUT_NEXT,
				CDAT_INPUT_LAST, CDAT_IMG_FILTER_0, CDAT_IMG_FILTER_1, CDAT_IMG_FILTER_2, CDAT_IMG_FILTER_3, CDAT_IMG_FILTER_4, CDAT_IMG_FILTER_5, 
				CDAT_IMG_FILTER_6, CDAT_IMG_FILTER_7, CDAT_IMG_FILTER_8, CDAT_IMG_FILTER_9, CDAT_IMG_FILTER_10, CDAT_IMG_FILTER_11
			});
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_LINK_NEW));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_IMG_REPORT_PREFERENCES));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_IMG_EXPORT));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_INPUT_FIRST));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_INPUT_PREVIOUS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_INPUT_NEXT));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_INPUT_LAST));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_IMG_FILTER_0));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_IMG_FILTER_1));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_IMG_FILTER_2));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_IMG_FILTER_3));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_IMG_FILTER_4));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_IMG_FILTER_5));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_IMG_FILTER_6));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_IMG_FILTER_7));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_IMG_FILTER_8));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_IMG_FILTER_9));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_IMG_FILTER_10));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(CDAT_IMG_FILTER_11));
	}
}
